<?php 
session_start(); 
 require_once './class/class_onlinestore.php'; 
 //include'./database/inc_OnlineStoreDB.php';
 include'./users/get_customers.php';

 
  if(class_exists("OnlineStore")){
    
    $store = new OnlineStore();
  }
  else{
        $errormsg[] = "The OnlineStore class is not available";
            $store = NULL;
      }

     if(logged_in() === TRUE){
      //$storeInfo = $store->getInventoryInformation();
      $session_customer_id = $_SESSION['customerID'];
       $cust_data = user_data($session_customer_id,'firstName', 'lastName', 'email', 'password_md5');
       $welcome = $cust_data['firstName'].' '. $cust_data['lastName'];

       //die(mysql_error());
     }
$errs = array();
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Tees For Africa</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="an online T-shirt shop">
    <meta name="author" content="">

    <!-- Le styles -->
    <link href="./css/bootstrap.css" rel="stylesheet">
    <style type="text/css">
     /* body {
         position: relative;
        padding-top: 40px;
        font-size: 13px;
      }

        Customize the navbar links to be fill the entire space of the .navbar */
      .navbar .navbar-inner {
        padding: 0;
      }
      .navbar .nav {
        margin: 0;
      }
      .navbar .nav li {
        float: none;
      }
      .navbar .nav li a {
        font-weight: bold;
        text-align: center;
        border-left: 1px solid rgba(255,255,255,.75);
        border-right: 1px solid rgba(0,0,0,.1);
      }
      .navbar .nav li:first-child a {
        border-left: 0;
        border-radius: 3px 0 0 3px;
      }
      .navbar .nav li:last-child a {
        border-right: 0;
        border-radius: 0 3px 3px 0;
      }
    </style>
    <link href="./css/bootstrap-responsive.css" rel="stylesheet">
    <link href="./css/bootstrap.min.css" rel="stylesheet">
    <link href="./css/prettify.css" rel="stylesheet">
    <link href="./css/style.css" rel="stylesheet">
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="../assets/js/html5shiv.js"></script>
    <![endif]-->

    <!-- Fav and touch icons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="./ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="./ico/apple-touch-icon-114-precomposed.png">
      <link rel="apple-touch-icon-precomposed" sizes="72x72" href="./ico/apple-touch-icon-72-precomposed.png">
                    <link rel="apple-touch-icon-precomposed" href="./ico/apple-touch-icon-57-precomposed.png">
                                   <link rel="shortcut icon" href="./ico/favicon.png">
  </head>

  <body>
     <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="brand" href="index.php">Tees For Africa</a>
          <div class="nav-collapse collapse">
            <ul class="nav">
              <li class="active"><a href="index.php">Home</a></li>
              <li><a href="men.php">Men</a></li>
              <li><a href="women.php">Women</a></li>              
              <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">My Account <b class="caret"></b></a>
                <ul class="dropdown-menu">
                <li><a href="register.php">Register</a></li>
                  <li><a href="#">Lost Password</a></li>
                  <li><a href="#">Edit My Address</a></li>
                  <li><a href="changepassword.php">Change Password</a></li>
                  <li class="divider"></li>
                  <li class="nav-header">Order</li>
                  <li><a href="history.php">History</a></li>
                     <li><a href="invoice.php">invoice</a></li>
                  <li class="divider"></li>
                  <li><a href="logout.php"><i class="icon-signout"></i>Logout</a></li>
                </ul>
              </li> 
              <li><a href="about.php">About</a></li>
              <li><a href="contact.php">Contact</a></li>                           
            </ul> 
            <?php 
            if(isset($_SESSION['customerID'])){
              //echo "logged in";   
              ?>
                <p class="navbar-text pull-right">
                  Welcome back, <?php echo $welcome; ?></a>
               </p>  
              <?php           
              //echo $welcome;
              
            }else{
              include './form_header/top_aside_header.php';
            }
              
              /*if($store->logged_in() === TRUE){
                include'./form_header/loggedin.php';
              }
              else{
                include './form_header/top_aside_header.php';
              }
              if(isset($_REQUEST['customerID'])){
                $CustomerID = $_REQUEST['customerID'];
              }else
                $CustomerID = -1;

                $errors = 0;
                $DBConnect = @mysql_connect("localhost", "root", "");
                if($DBConnect === FALSE){
                  echo "<p>Unable to connect to the database server. " ."Error code " . mysql_errno() . ": " .
                       mysql_error() . "</p>\n";
                            ++$errors;
                }
                else{
                  $DBName = "online_store";
                  $results = @msql_select_db($DBName, $DBConnect);
                  if ($results === FALSE) {
                    # code...
                    echo "<p>Unable to select the database. " .
                            "Error code " . mysql_errno($DBConnect) .
                                ": " . mysql_error($DBConnect) .
                           "</p>\n";
                         ++$errors;
                  }
                }*/
                //include './form_header/top_aside_header.php'; 
            ?>           
          </div><!--/.nav-collapse -->
        </div>
      </div>      
    </div>